
<div id="nav" style="display:none;">
  <dl>
    <dt>当前位置：</dt>
    <dd class="link">网址管理</dd>
    <!--导航-->
    <dd class="link">添加分类</dd>
    <!--导航-->
  </dl>
</div>
<script type="text/javascript">
	if ($.browser.msie) {
		document.execCommand("BackgroundImageCache", false, true);
	}
	var nav = document.getElementById("nav");
	var pnav = window.parent.document.getElementById("nav");
	pnav.innerHTML = nav.innerHTML;
</script>
<div class="wrap">
  <div class="container">
    <div id="main">
      <div class="con box-green">
        <form action="<?php echo Yii::app()->createUrl('UrlClass/update',array('id'=>$model->classid));?>" method='post'>
          <div class="box-header">
            <h4>添加分类</h4>
          </div>
          <div class="box-content">
            <table class="table-font">
              <tr>
                <th class="w120">分类名称：</th>
                <td><input type="text" name="UrlClass[classname]" class="textinput w270" value="<?php echo $model->classname; ?>" /></td>
              </tr>
              <tr style="display:none;">
                <th>自定义路径/文件名：</th>
                <td><input type="text" name="UrlClass[path]" class="textinput w270" value="<?php echo $model->path; ?>" /></td>
              </tr>
              <tr>
                <th>分类排序：</th>
                <td><input name="UrlClass[displayorder]" type="text" id="orderid" class="textinput" onkeyup="value=value.replace(/[^\d]/g,'') " value="<?php echo $model->displayorder; ?>"/></td>
              </tr>
              <tr>
                <th>keywords：</th>
                <td><input type="text" name='UrlClass[keywords]' class="textinput w360" value="<?php echo $model->keywords; ?>" /></td>
              </tr>
              <tr>
                <th  style="vertical-align:top;">description：</th>
                <td><textarea name='UrlClass[description]' class="w360"><?php echo $model->description; ?></textarea></td>
              </tr>
              <tr>
                <th  style="vertical-align:top;">所属的分类是：</th>
                <td><div id="classSearch" class="fl ml5" style="_margin-top:-6px;">
                    <input type="text" id="tool_kw" autocomplete="off" onclick="(this.value == '快速搜索分类') ? this.value='' :''" onblur="(this.value == '') ? this.value='快速搜索分类' :''" onmouseover="this.select()" value="快速搜索分类" class="textinput gray9 w270 mt5" />
                  </div>
                  <div style="clear:both"></div>
                  <input id="js_submit_classid" type="hidden" name="UrlClass[parentid]" value="<?php echo $model->parentid; ?>"/>
                  <div id="cate" style="height:30px; line-height:30px;">您选择的分类：<span id="js_link_text_span"><?php echo $class_path_names_string?></span></div>
                  <div><input type="button" onclick="CateListManager.SelectClass('');" value="移到主目录"> 
                                <span style="color:red">&lt;&lt; 点击此按钮移到主目录，若选择分类则移到分类的下一级。</span></div>
                  <div id="cate_list">
                    <table>
                      <tr id="js_cate_list">
                        <td index="0"><ol>
                        	<?php foreach($root_class as $k=>$v){?>
                            <li classid="<?php echo $v['classid']?>"><?php echo $v['classname']?></li>                            
                            <?php }?>
                          </ol></td>
                      </tr>
                    </table>
                  </div>
                  
                  <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/assets/js/cate_list_manager.js"></script> 				  
                  <script type="text/javascript">
								CateListManager.Init();
								CateListManager.SelectClass('<?php echo $class_path;?>');
								CateListManager.AjaxUrl = '<?php echo Yii::app()->createUrl('UrlClass/ajaxgetlist',array('parentid'=>''));?>';
								
                            </script></td>
              </tr>
            </table>
          </div>
          <div class="box-footer">
            <div class="box-footer-inner">
              <input type="submit" value="修改" />
              或 <a href="<?php echo Yii::app()->createUrl('UrlClass/index');?>">取消</a> </div>
          </div>
        </form>
      </div>
      <!--/ con--> 
      
    </div>
  </div>
  <!--/ container--> 
  
</div>
<!--/ wrap-->
<div id="js_search_msg" class="js_search_msg" style="display:none;"></div>
<style type="text/css">
	.js_search_msg{ position:absolute; background:#fff; border:1px solid #CEDEAE;}
	.js_search_msg li{ padding:3px 5px; cursor:pointer;}
	.js_search_msg li.active{ background:#EBF4D8}
</style>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/assets/js/textboxdrop.js"></script> 
<script type="text/javascript">
	$(document).ready(function(){
		$(".admin-tb").find("input[rel='del']").each(function(i){
			$(this).bind("click",function(){
				$(".admin-tb").find("input[rel='del']").each(function(i){
					var tr = $(this).parent().parent();
					if(this.checked){
						tr.addClass("checked");
					}
					else{
						tr.removeClass("checked");
					}
				})
				
			})
		});					   
		
		var t = new TextBoxDrop("tool_kw","js_search_msg");
		t.SetEnterHandler (function(ele){
							CateListManager.SelectClass($(ele).attr("rel"));
					});
		t.DefaultKey = "id_list";
		t.SetAjaxMethod($.get);
		t.Url('<?php echo Yii::app()->createUrl('UrlClass/search',array('k'=>''));?>');
		t.SetContentStyle(function(intput,contentbox){
			var inputBox = $(intput);
			if($.browser.ie){
				contentbox.style.left = inputBox.offset().left;
				contentbox.style.top = inputBox.offset().top + 23;
			}
			else{
				$(contentbox).css({
					top : inputBox.offset().top + 23,
					left: inputBox.offset().left
				});
			}
		});
		t.DisplayContentHandler(function(input,contentbox){						   
			if($(contentbox).width() < $(input).outerWidth()){
				$(contentbox).width($(input).outerWidth());
			}
		});
	});
</script>
<p style="text-align:center;padding:15px;color:#6B7355;
font-family:Verdana;
font-size:12px;"> Powered by <a href="http://www.ylmf.com" target="_blank"> <b>雨林木风</b></a> &copy; 2009 <a href="http://www.114la.com" target="_blank"> <b>114la.com</b></A><a href="http://www.ylmf.com" target="_blank"></a> </p>
